package com.example.win.android_banduyujia.peopleactivity.ui.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.example.win.android_banduyujia.peopleactivity.ui.item.AlbumItem;
import com.example.win.android_banduyujia.peopleactivity.ui.model.AlbumModel;

import java.util.ArrayList;

/**
 * Created by Win on 2015/9/17.
 */
public class AlbumAdapter extends MBaseAdapter<AlbumModel> {

    public AlbumAdapter(Context context, ArrayList<AlbumModel> models) {
          super(context, models);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        AlbumItem albumItem;
        if(convertView == null){
            albumItem = new AlbumItem(context);
            convertView = albumItem;
        }else
            albumItem = (AlbumItem) convertView;
            albumItem.update(models.get(position));

        return convertView;
    }
}
